package com.rc.evcharger.common.type;

import com.rc.evcharger.common.annotation.ByteLength;

import java.lang.reflect.Field;

/**
 * Create by Yang on 2021/3/31
 */
public class UserAccountData extends BaseType implements DataType {

    @ByteLength(length = 1)
    String gunNum;

    @ByteLength(length = 4)
    String userAccount;

    @ByteLength(length = 4)
    public String obligate = "00 00 00 00";

    public String getGunNum() {
        return gunNum;
    }

    public void setGunNum(String gunNum) {
        this.gunNum = gunNum;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getObligate() {
        return obligate;
    }

    public void setObligate(String obligate) {
        this.obligate = obligate;
    }

    //@Override
    //public UserAccountData getResult(String dataStr) {
    //    dataStr = dataStr.trim();
    //    this.gunNum = dataStr.substring(0, 2);
    //    dataStr = dataStr.substring(3);
    //    this.userAccount = dataStr.substring(3, 14);
    //    dataStr = dataStr.substring(15);
    //    this.obligate = dataStr.substring(16);
    //    //this.userAccount = (userAccountStr, 2, false);// 两位小数
    //    return this;
    //}

    @Override
    public boolean customField(Field field, StringBuffer sb) {
        return false;
    }
}
